using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Gadgets.Setups
{
	public partial class eCalendar : WeifenLuo.WinFormsUI.Docking.DockContent  
	{
		public eCalendar()
		{
			InitializeComponent();
		}

		private void eCalendar_Load(object sender, EventArgs e)
		{
			try
			{
                DataSet data = new DataSet();
                DataTable table = new DataTable("GridView");
                foreach (Xceed.Grid.Column col in gridControl1.Columns)
                {
                    table.Columns.Add(new DataColumn(col.FieldName, col.DataType));
                }
                data.Tables.Add(table);
                gridControl1.SetDataBinding(data, "GridView");
                colTRANS_DATE.FormatSpecifier = DeclareLibrary.DATE_DISPLAY_FORMAT;
                colSETTLE_DATE.FormatSpecifier = DeclareLibrary.DATE_DISPLAY_FORMAT;
                colT1_DATE.FormatSpecifier = DeclareLibrary.DATE_DISPLAY_FORMAT;
                colT2_DATE.FormatSpecifier = DeclareLibrary.DATE_DISPLAY_FORMAT;
                colNEXT_DATE.FormatSpecifier = DeclareLibrary.DATE_DISPLAY_FORMAT;
			}
			catch (Exception ex)
			{
				 ABSCommonLibrary.ShowErrorMessage(ex.ToString());
			}
		}

		private void load_list()
		{
            DataSet v_data = ABSCommonLibrary.DoInquiry(
                CommonLibrary.CommonLibrary.BOSC017002, new object[0] { });
            gridControl1.SetDataBinding(v_data, v_data.Tables[0].TableName);
		}

        private void eCalendar_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F9)
            {
                load_list();
            }
        }
		
	}
}